home *** CD-ROM | disk | FTP | other *** search
/ Animation / Animation Vol.1 (Profi ROM)(1994).iso / csv / dmpeg.doc < prev    next >
Text File  |  1993-05-23  |  13KB  |  354 lines

  1.  
  2.                               DMPEG V1.1
  3.  
  4.                        Public Domain MPEG decoder
  5.  
  6.                            by Stefan Eckart
  7.  
  8.                                June 1993
  9.  
  10. 1. Features
  11. ===========
  12.  
  13. DMPEG is another MPEG decoder/player for the PC:
  14.  
  15.  
  16.  - decodes (nearly) the full MPEG video standard
  17.    (I,P,B frames, frame size up to at least 352x288)
  18.  
  19.  - can save decoded sequence in 8 or 24bit raw file for
  20.    fast off-line display (two pass mode)
  21.  
  22.  - optional on-screen display during decoding
  23.  
  24.  - several dithering options for 8 bit displays:
  25.      ordered dither, Floyd-Steinberg, grayscale
  26.  
  27.  - selectable color-space
  28.  
  29.  - runs under DOS, 640KB RAM, no MS-Windows or '386 required
  30.  
  31.  - compact (small code / small data models, 16 bit arithmetic)
  32.  
  33.  - supports VGA, many Super-VGAs (including VESA) and
  34.    some TrueColor SVGAs
  35.  
  36.  
  37. 2. Introduction
  38. ===============
  39.  
  40. DMPEG is a Public Domain decoder for files containing MPEG video
  41. sequences. MPEG is a standardized format for compressed storage of video
  42. (and audio), similar in concept to JPEG for individual images. It,
  43. however, provides higher compression by exploiting the similarity of
  44. consecutive images of a sequence, so called interframe coding. As with
  45. JPEG, the compression factor depends on the source material and the
  46. desired quality of the coded sequence. A compression to less than 5% of
  47. the original material is not uncommon.
  48.  
  49. DMPEG supports the full MPEG video standard, except D-frame sequences.
  50. Decoding is not very fast, therefore a two-pass mode was implemented:
  51. during the first pass the sequence is decoded and stored in an unencoded
  52. file which then can be played at maximum speed during the second pass.
  53. Of course DMPEG also has a one-pass mode where the sequence is displayed
  54. immediately but at lower speed. The speed is about one seventh of that
  55. of the Xing MPEG decoder (see appendix A). The Xing player, however, can
  56. only decode I frame sequences of size 160x120 and needs a '386. I
  57. suggest to use DMEG in addition to Xing's MPEG.EXE 320x200 DOS player.
  58. The latter is appropriate for real-time display of '160x120, I-frame
  59. only' Xing files, DMPEG is more suitable for larger size 'real' MPEGs
  60. containing I, P and B type, 352x288 sized frames or for faster and
  61. better quality 'off-line' display of the 160x120 MPEGs. Try it on one of
  62. the larger MPEG files (see appendix, my recommendation: flowg.mpg) to
  63. see that MPEG can also be used (and is intended) for storing really
  64. sharp, virtually noise-free sequences.
  65.  
  66. To give an impression of the attainable speeds, here are some figures
  67. measured on a 386DX/33 with 4MB RAM and a Conner 3104 100 MB hard disk.
  68. The decoding time for flowg.mpg (352x240) was about 4 sec per frame, 9
  69. minutes for 150 frames. waterski.mpg (336x208 and higher compression)
  70. required only 2.4 sec per frame. A decoded 150 frame raw data file is
  71. 12 MB long and can be displayed at 5.2 frames/s. 160x120 MPEGs reach
  72. 22 frames/s while the decoding speed is 1.9 sec/frame. The display frame
  73. rate is limited by the transfer speed from hard disk to memory (about
  74. 550 kByte/s on my PC). If you have enough RAM, you can obtain much
  75. higher speed by playing from a large RAM-disk (e.g 23 frames/s for a
  76. 352x240 sequence).
  77.  
  78. This program is Public Domain and I don't take any responsibility
  79. regarding its fitness, usefulness etc. (#include
  80. <your_favourite_disclaimer>). Comments, bug reports, questions to:
  81.  
  82.   Stefan Eckart
  83.   Kagerstr. 4
  84.   D-81669 Muenchen
  85.   Germany
  86.  
  87.   email: stefan@lis.e-technik.tu-muenchen.de
  88.  
  89. Any feedback is welcome.
  90.  
  91.  
  92. 3. Usage
  93. ========
  94.  
  95.   dmpeg [options] input.mpg [output.raw]
  96.  
  97.   dmpeg [options] input.raw
  98.  
  99. input.mpg   any MPEG DIS 11172 compliant non multiplexed compression
  100.             layer video stream (D frame streams unsupported)
  101.  
  102. output.raw  the decoded and dithered 8 or 24bit raw output file;
  103.             if omitted: output to screen only
  104.  
  105. input.raw   previously decoded raw file to be displayed at maximum speed
  106.  
  107. Options:
  108.  
  109.  -q     quiet mode; no text output (except error messages)
  110.  -v     verbosity level; can be increased by repeating this option;
  111.         enables display of decoded information (start codes, frame size,
  112.         quantization scales etc.), can't be combined with the -s option
  113.  
  114.  -dx    dithering options:
  115.  
  116.  -d0    ordered, saturation dominant 4x4 dither (default)
  117.  -d1    Floyd-Steinberg error-diffusion / blue-noise-shaping (2 weights)
  118.  -d2    Floyd-Steinberg error-diffusion / blue-noise-shaping (4 weights)
  119.  -d3    undithered grayscale output
  120.  -d4    24 bit true color output
  121.  
  122.  -p0    use full color range palette
  123.  -p1    use restricted color range palette (default)
  124.  
  125.  -sn    select graphics adapter:
  126.  
  127.  -s0    either standard VGA or Super-VGA in 320x200x256 mode (default)
  128.         (options -d0..3) or a TrueColor VGA with VESA BIOS in
  129.         320x200x16M mode (option -d4)
  130.  -s1    VESA BIOS, either 640x480x256 (-d0..3) or 640x480x16M (-d4)
  131.  -s2    ET4000               \
  132.  -s3    ET3000               |
  133.  -s4    Video 7              |
  134.  -s5    Paradise             | 640x480x256
  135.  -s6    Trident              | (options -d0..3 only)
  136.  -s7    Chips & Technologies |
  137.  -s8    ATI                  |
  138.  -s9    Orchid               |
  139.  -s10   Oaktech              /
  140.  
  141.  -lx   delay (x=0..65535, default 0), used only for offline display
  142.  
  143.  -b    use 8 bit transfer (default: 16 bit) into (S)VGA memory
  144.  
  145.  
  146. Options can be combined. Example:
  147.  
  148.   dmpeg -d2s0 flowg.mpg flowg.raw
  149.  
  150. decodes MPEG file flowg.mpg to raw file flowg.raw using FS4 dithering
  151. and displays it on the screen in 320x200x256 mode.
  152.  
  153.   dmpeg -vvv flowg.mpg flowg.raw
  154.  
  155. as above but using ordered dither and printing much information about
  156. startcodes, headers and parameters.
  157.  
  158. All SVGA drivers use the 640x480x256 display mode and require at least
  159. 512 kB of video memory. If your graphics card is not listed, the best
  160. you can do (besides trying all drivers in the hope that one of them
  161. might work) is to obtain a VESA BIOS extension for your card and use
  162. mode -s1. A collection of such drivers had been posted to
  163. comp.binaries.ibm.pc and is also available at
  164. ftp.rahul.net:/pub/bryanw/pc/vesadrv2.zip (anonymous ftp).
  165.  
  166. All drivers except the standard VGA, ET4000, the VESA driver in
  167. conjunction with the mentioned public domain VESA BIOS extension TSR for
  168. the ET4000 and the TrueColor driver with a Cirrus Logic VGA are
  169. untested. I'm very interested in email feedback which drivers work and
  170. which don't.
  171.  
  172. The -l option controls playback speed. It is implemented as a simple
  173. delay loop without synchronization to a timer or vertical retrace.
  174.  
  175. The -b option is probably superfluous. I don't have much experience in
  176. PC graphics programming and since I saw some example driver routines
  177. using bytewise transfer (rep movsb) instead of wordwise (rep movsw) I
  178. preferred to include this as a fudge factor. You should try it only in
  179. case of problems. Speed is reduced considerably if you activate this
  180. switch (at least for cards with 16 bit bus interface).
  181.  
  182. Decoding can be terminated by pressing any key.
  183.  
  184. Offline display can be controlled with the following keys:
  185.  
  186.   any key except
  187.   space, return
  188.   or escape       halt display at current frame and step one frame
  189.                   forward each time a key is pressed
  190.  
  191.   space           step one frame backwards
  192.  
  193.   return          continue display
  194.  
  195.   escape          quit program
  196.  
  197.  
  198. 4. Technical information
  199. ========================
  200.  
  201. The player is a rather straightforward implementation of the MPEG spec
  202. [1]. The IDCT is based on the Chen-Wang 11 multiplication algorithm [2]
  203. which was coded in assembler but does not use tables for multiplication.
  204. Blocks with not more than two non-zero coefficients use a non-separated
  205. direct multiply-accumulate 2D-IDCT, which turned out to be faster than a
  206. 'fast' algorithm in this (quite common) case. Dithering is pretty
  207. standard. Main difference to the Berkeley decoder (except for the fewer
  208. number of supported algorithms) is the use of 256 instead of 128 colors,
  209. the (default) option to use a restricted color-spa